<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*"%>
<jsp:useBean id="db" scope="page" class="com.dj.conn.DataBean"></jsp:useBean>
<%
	     
	ResultSet rs = null;

	String ID = request.getParameter("modId");

	rs = db.executeQuery("select * from template_file where templateID="+ID); 
	while(rs.next()) {
		try	{
			java.io.InputStream in = rs.getBinaryStream("filebody");
			java.io.OutputStream outStream = response.getOutputStream();
			byte[] buf = new byte[1024];
			int bytes = 0;
			while((bytes = in.read(buf)) != -1)
				outStream.write(buf, 0, bytes);
				in.close();	
				outStream.close();
				out.clear();
				out= pageContext.pushBody();
		}
		catch(Throwable e) {
			out.println(e.toString());
		}
	}
	rs.close();
	db.close();
%>
